﻿# CMakeList.txt: ComputerGraphics 的 CMake 项目，在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)

# Enable Hot Reload for MSVC compilers if supported.
#if (POLICY CMP0141)
#  cmake_policy(SET CMP0141 NEW)
#  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
#endif()

project (ComputerGraphics)

find_library(FreeGLUT
	NAMES freeglut.lib
	HINTS ${PROJECT_SOURCE_DIR}/libs/freeglut/lib
	REQUIRED
	NO_DEFAULT_PATH
)

find_library(GLEW
	NAMES glew32.lib
	HINTS ${PROJECT_SOURCE_DIR}/libs/glew-2.1.0/lib/Release/Win32
	REQUIRED
	NO_DEFAULT_PATH
)

if (FreeGLUT-NOTFOUND)
message(FATAL_ERROR "FreeGLUT not found!")
endif ()

if (GLEW-NOTFOUND)
message(FATAL_ERORR "GLEW not found!")
endif()

include_directories(${PROJECT_SOURCE_DIR}/libs/freeglut/include)
message(STATUS "includes: ${PROJECT_SOURCE_DIR}/libs/freeglut/include")

include_directories(${PROJECT_SOURCE_DIR}/libs/glew-2.1.0/include)
message(STATUS "includes: ${PROJECT_SOURCE_DIR}/libs/glew-2.1.0/include")

add_subdirectory(chapter03)
add_subdirectory(chapter04)
add_subdirectory(chapter05)
add_subdirectory(chapter06)
add_subdirectory(chapter07)
add_subdirectory(chapter08)
add_subdirectory(chapter09)
add_subdirectory(chapter10)
add_subdirectory(chapter12)
add_subdirectory(chapter13)
add_subdirectory(chapter14)
add_subdirectory(chapter18)
add_subdirectory(chapter20)
add_subdirectory(chapter22)

#add_executable (ComputerGraphics "main.cpp" )
#target_link_libraries(ComputerGraphics ${FreeGLUT})
#target_include_directories(ComputerGraphics PUBLIC ${PROJECT_SOURCE_DIR}/libs/freeglut/include)

#if (CMAKE_VERSION VERSION_GREATER 3.12)
#  set_property(TARGET ComputerGraphics PROPERTY CXX_STANDARD 20)
#endif()
